package StudyCode.summary.mycollection;

import java.util.Dictionary;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class ConvertDictionaryToMap {
	@SuppressWarnings({"rawtypes", "unchecked"})
	public static Map convertDictionaryToMap(Dictionary dict) {
		Map result = new HashMap();
		for (Enumeration e = dict.keys(); e.hasMoreElements(); ) {
			String key = (String) e.nextElement();
			Object value = dict.get(key);
			result.put(key, String.valueOf(value));
		}
		return result;
	}
}
